package com.bridgeintelligent.tag.customer.service;

import com.bridgeintelligent.tag.customer.entity.AnalysisSetup;
import com.bridgeintelligent.tag.customer.mapper.AnalysisSetupMapper;
import com.wayneleo.quickstart.framework.IDGenerator;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 分析设置服务层接口实现
 */
@Service
@Transactional(rollbackFor = Exception.class)
@AllArgsConstructor
@Slf4j
public class AnalysisSetupServiceImpl implements IAnalysisSetupService {

    private AnalysisSetupMapper setupMapper;

    @Override
    public void add(AnalysisSetup setup) {
        setup.setId(IDGenerator.gen());
        setupMapper.addAnalysisSetup(setup);
    }

    @Override
    public void update(AnalysisSetup setup) {
        setupMapper.updateAnalysisSetup(setup);
    }

    @Override
    public void delById(String id) {
        setupMapper.delAnalysisSetup(id);
    }

    @Override
    public void delByTpId(String tpId) {
        setupMapper.delSetupByTpId(tpId);
    }

    @Override
    public AnalysisSetup findById(String id) {
        return setupMapper.findAnalysisSetup(id);
    }


    @Override
    public List<AnalysisSetup> findList( String tpId) {
        return setupMapper.findByTpId(tpId);
    }

}
